home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 August (Alt) / CHIP 2005-08.1.iso / program / guvenlik / syslinux-3.07.exe / com32 / lib / strcmp.c < prev    next >
Encoding:
C/C++ Source or Header  |  2004-11-10  |  270 b   |  21 lines

  1. /*
  2.  * strcmp.c
  3.  */
  4.  
  5. #include <string.h>
  6.  
  7. int strcmp(const char *s1, const char *s2)
  8. {
  9.   const unsigned char *c1 = s1, *c2 = s2;
  10.   unsigned char ch;
  11.   int d = 0;
  12.  
  13.   while ( 1 ) {
  14.     d = (int)(ch = *c1++) - (int)*c2++;
  15.     if ( d || !ch )
  16.       break;
  17.   }
  18.  
  19.   return d;
  20. }
  21.